Computer virtualization is a technique that involves encapsulating a physical computing machine platform into virtual machine(s) executing under control of virtualization software on a hardware computing platform or “host” (collectively referred to as a “virtualized computing system”). A virtual machine (VM) provides virtual hardware abstractions for processor, memory, storage, and the like to a guest operating system (OS) and guest application(s) that run on the guest OS. The virtualization software, also referred to as a “hypervisor,” includes one or more virtual machine monitors (VMMs) to provide execution environment(s) for the virtual machine(s). The hypervisor itself can be an OS having a kernel and user applications that run on the kernel. Thus, a virtualized computing system can include various software components executing on the hardware, including the hypervisor kernel, hypervisor user application(s), guest OS(s), and guest application(s).
Some central processing unit(s) execute code at multiple hierarchical privilege levels, each of which provides a different set of constraints. Examples include CPUs compatible with the ARM®v7 and ARM®v8 (Instruction Set Architecture versions 7 and 8) hardware architectures, which are commercially available from ARM Holdings of Cambridge, England. The various software components of a virtualized computing system can execute at different privilege levels of the hardware architecture.
As part of transitioning execution control from one software component to another, the hypervisor performs a context switch, i.e., storing and restoring component-specific state, such as memory and processor state. Context switches have a performance impact that requires careful optimization and mitigation. Efficient management of page tables, exception vectors (i.e., fixed memory addresses to which execution is directed in response to interrupts and other processor exception events), and the like to optimize context switches across various software components noticeably improves the performance of the virtualized computing system. To perform efficient context switches in architectures with multiple hierarchical privilege levels, a strategy that judiciously assigns and manages hypervisor components across the privilege levels is desirable.